
package com.cbwl.eoas.cms.model.eoas;

import javax.validation.constraints.NotNull;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
import org.springframework.util.StringUtils;

import com.cbwl.eoas.common.base.CommonBean;
import com.cbwl.eoas.common.cache.redis.RedisCache;
import com.cbwl.eoas.common.cache.redis.RedisKeyPrefix;
import com.cbwl.eoas.common.util.SpringContextUtil;


/**
 * 
 * <p>[描述信息：说明类的基本功能]</p>
 *
 * @author 虞云波 - yuyunbo@3856.cc
 * @version 1.0 Created on 2017年10月20日 下午5:21:23
 */
public class AppSmsLogDTO extends CommonBean {

	
	private static final long serialVersionUID = -3641957228369881614L;
	private java.lang.Long id;
	@NotBlank @Length(max=11)
	private java.lang.String smsTelephone;
	@NotBlank @Length(max=512)
	private java.lang.String smsContent;
	@NotNull 
	private java.util.Date smsTime;
	@NotBlank @Length(max=5)
	private java.lang.String smsSrc;
	@Length(max=256)
	private java.lang.String smsReturncode;
	@Length(max=20)
	private java.lang.String smsCode;
	
	private java.lang.Long creater;
	
	private java.util.Date gmtCreate;
	
	private java.lang.Long modifier;
	
	private java.util.Date gmtModified;
	//columns END

	//标识验证码查询
	private String selectType;
	
	private String smsSrcName;
	
	
	private String datemin;
	
	private String datemax;
	
	
	public String getDatemin() {
		return datemin;
	}

	
	public void setDatemin(String datemin) {
		this.datemin = datemin;
	}

	
	public String getDatemax() {
		return datemax;
	}

	
	public void setDatemax(String datemax) {
		this.datemax = datemax;
	}

	public void setId(java.lang.Long value) {
		this.id = value;
	}
	
	public java.lang.Long getId() {
		return this.id;
	}
	
	public void setSmsTelephone(java.lang.String value) {
		this.smsTelephone = value;
	}
	
	public java.lang.String getSmsTelephone() {
		return this.smsTelephone;
	}
	
	public void setSmsContent(java.lang.String value) {
		this.smsContent = value;
	}
	
	public java.lang.String getSmsContent() {
		return this.smsContent;
	}
	
	public void setSmsTime(java.util.Date value) {
		this.smsTime = value;
	}
	
	public java.util.Date getSmsTime() {
		return this.smsTime;
	}
	
	public void setSmsSrc(java.lang.String value) {
		this.smsSrc = value;
		if (!StringUtils.isEmpty(value)) {
			RedisCache<String, String> redisCache = (RedisCache<String, String>) SpringContextUtil.getBean("redisCache");
			String redisValue =  redisCache.getStr(RedisKeyPrefix.DIC_PREFIX+value);
			if (!StringUtils.isEmpty(redisValue)) {
				this.smsSrcName = redisValue;
			}
		}
	}
	
	public java.lang.String getSmsSrc() {
		return this.smsSrc;
	}
	
	public void setSmsReturncode(java.lang.String value) {
		this.smsReturncode = value;
	}
	
	public java.lang.String getSmsReturncode() {
		return this.smsReturncode;
	}
	
	public void setSmsCode(java.lang.String value) {
		this.smsCode = value;
	}
	
	public java.lang.String getSmsCode() {
		return this.smsCode;
	}
	
	public void setCreater(java.lang.Long value) {
		this.creater = value;
	}
	
	public java.lang.Long getCreater() {
		return this.creater;
	}
	
	public void setGmtCreate(java.util.Date value) {
		this.gmtCreate = value;
	}
	
	public java.util.Date getGmtCreate() {
		return this.gmtCreate;
	}
	
	public void setModifier(java.lang.Long value) {
		this.modifier = value;
	}
	
	public java.lang.Long getModifier() {
		return this.modifier;
	}
	
	public void setGmtModified(java.util.Date value) {
		this.gmtModified = value;
	}
	
	public java.util.Date getGmtModified() {
		return this.gmtModified;
	}
	
	public String getSelectType() {
		return selectType;
	}

	
	public void setSelectType(String selectType) {
		this.selectType = selectType;
	}
	
	public String getSmsSrcName() {
		return smsSrcName;
	}

	
	public void setSmsSrcName(String smsSrcName) {
		this.smsSrcName = smsSrcName;
	}

	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("Id",getId())
			.append("SmsTelephone",getSmsTelephone())
			.append("SmsContent",getSmsContent())
			.append("SmsTime",getSmsTime())
			.append("SmsSrc",getSmsSrc())
			.append("SmsReturncode",getSmsReturncode())
			.append("SmsCode",getSmsCode())
			.append("Creater",getCreater())
			.append("GmtCreate",getGmtCreate())
			.append("Modifier",getModifier())
			.append("GmtModified",getGmtModified())
			.toString();
	}
	
	public int hashCode() {
		return new HashCodeBuilder()
			.append(getId())
			.toHashCode();
	}
	
	public boolean equals(Object obj) {
		if(obj instanceof AppSmsLogDTO == false){return false;}
		if(this == obj){return true;}
		AppSmsLogDTO other = (AppSmsLogDTO)obj;
		return new EqualsBuilder()
			.append(getId(),other.getId())
			.isEquals();
	}
}

